{% extends "dsaboard.html" %}

{% block main %}
    <h1>文章列表</h1>
    <a class="btn btn-primary btn-sm" href="{% url 'article_add' %}" ><i class="fa fa-plus"></i></a>

    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <th>序号</th>
            <th>id</th>
            <th>标题</th>
            <th>分类</th>
            <th>创建时间</th>
            <th>发布状态</th>
            <th>发布状态2</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for article in all_articles %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ article.pk }}</td>
                <td>{{ article.title }}</td>
                <td>{{ article.category.title|default:"-"}}</td>
                <td>{{ article.create_time }}</td>
                <td>{{ article.get_publish_status_display }}</td>
                <td>{{ article.show_publish_status }}</td>
{#                <td><a href="{% url "article_edit" article.pk %}"><i class="fa fa-edit"></i></a></td>#}
                {% load my_tags %}
                <td>
                    <a href="{% reverse_url request "article_edit" article.pk %}"><i class="fa fa-edit"></i></a>
                    <a href="{% reverse_url request "article_del" article.pk %}"><i class="fa fa-trash-o"></i></a>

                </td>
            </tr>
        {% endfor %}


        </tbody>
    </table>
    {{ page_html|safe }}
{% endblock %}